<?php
namespace Admin\Controller;
class IndexController extends BaseController {
	public function index(){
		$state=S('state');
		$url = 'http://' . $_SERVER['HTTP_HOST'] . U('Index/index');
		$this->assign('url', $url);
		
		/*动态生成菜单*/
		$ModuleList = M('Module');
		$this->assign('moduleList',$ModuleList -> select());
		
		$this->assign('supmenuList',M("menu") ->where("(pid is null or pid='0' )and type=0") -> select());
		$this->assign('submenuList',M("menu") ->where("pid is not null") -> select());
		
		$this->display();
    }

    public function system(){
        $state=S('state');
        $url = 'http://' . $_SERVER['HTTP_HOST'] . U('Index/index');
        $this->assign('url', $url);
    
        /*动态生成菜单*/
        $ModuleList = M('Module');
        $this->assign('moduleList',$ModuleList -> select());
    
        $this->assign('supmenuList',M("menu") ->where("(pid is null or pid='0' ) and type=1") -> select());
        $this->assign('submenuList',M("menu") ->where("pid is not null") -> select());
    
        $this->display();
    }

    public function main(){
//         $db=M('order');
//         $list=$db->where($where)->order('s_time desc')->limit(8)->select();
//         $this->assign('list',$list);
        $this->display();
    }

    public function no(){
        $this->error('此功能正在开发,请期待...');
    }
}